package PolymorphicHomeworkTest2;

public class BasePlusSalesEmployee extends SalesEmployee{
    private double basicSalary;

    public BasePlusSalesEmployee() {
    }

    public BasePlusSalesEmployee(String name,double saleroom,double royaltyRate,int month,double basicSalary) {
        super(name,month,saleroom,royaltyRate);
        this.basicSalary = basicSalary;
    }

    public double getBasicSalary() {
        return basicSalary;
    }

    public void setBasicSalary(double basicSalary) {
        this.basicSalary = basicSalary;
    }

    public double getSalary(int month){
        double sumSalary = 0;
        sumSalary = this.basicSalary + (super.getSaleroom() * super.getRoyaltyRate());
        if(super.getMonth() == month){
            sumSalary += 100;
        }
        return sumSalary;
    }
}
